#include "smallWidget.h"
#include <QSpinBox>
#include <QSLider>

smallWidget::smallWidget(QWidget *parent)
	: QWidget(parent)
    ,ui(new Ui::smallWidgetClass())
{
	ui->setupUi(this);

	connect(ui->spinBox, SIGNAL(valueChanged(int)), ui->horizontalSlider, SLOT(setValue(int)));

	connect(ui->horizontalSlider, SIGNAL(setValue(int)), ui->spinBox, SLOT(valueChanged(int)));


	void (QSpinBox:: * spSignal)(int) = &QSpinBox::valueChanged;
	connect(ui->horizontalSlider, &QSlider::valueChanged, ui->spinBox, &QSpinBox::setValue);

}


void smallWidget::setNum(int num)
{
	ui->spinBox->setValue(num);
}

int smallWidget::getNum()
{
	return ui->spinBox->value();
}



smallWidget::~smallWidget()
{
	delete ui;
}
